package cn.big.bigd.biocode.controller;


import cn.big.bigd.biocode.service.ToolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 *@Author wangfan
 *@Date 2018/1/18 16:11
 */


@Controller
@RequestMapping("stats")
public class StatisticController {





    @Autowired
    ToolService toolService;




    @RequestMapping(value = {"", "/"})
    public String home(Model model) {
        List<Map<String,Object>> topUsers = toolService.findTopUsers();
        List<Map<String,Object>> topOrgs = toolService.findTopOrgs();
        model.addAttribute("topUsers",topUsers);
        model.addAttribute("topOrgs",topOrgs);

        return "statistic/index";
    }





}
